# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
# config.vm.box = "bigleaf/debian9"
  config.vm.box = "generic/devuan3"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  config.vm.box_check_update = false

# # Optionally cache packages
# if Vagrant.has_plugin?("vagrant-cachier")
#   config.cache.scope = :box
# end

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  config.vm.synced_folder ".vagrant-folder", "/vagrant" #, disabled: true
# config.vm.synced_folder ".vagrant-folder", "/home/cyclone/vagrant",
#?  owner: "cyclone", group: "users",
#   mount_options: ["uid=1000", "gid=100"]

  config.vm.provider "virtualbox" do |vb|
    vb.memory = 1024
    vb.cpus   = 2

#   # Add disk space
#   disk = File.join(File.realpath(File.expand_path(__dir__)), "fabric-devenv-disk.vmdk").to_s
#   if not File.exists?(disk)
#     vb.customize ["createmedium", "disk", "--filename", disk, "--format", "vmdk", "--size", 1024 * 20]
#     vb.customize ["storageattach", :id,  "--storagectl", "SCSI", "--port", 2, "--device", 0, "--type", "hdd", "--medium", disk]
#   end
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

# config.vm.provision :shell, inline: <<-SHELL
#   alias ll="ls -la"

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  config.vm.provision :shell, inline: <<-SHELL
    export DEBIAN_FRONTEND=noninteractive
    apt-get update -y
    apt-get install -y --no-install-recommends python3.5
    apt-get install -y --no-install-recommends virtualenv
#   apt-get install -y python3-pip
#   apt-get install -y python3-gdbm  # paver
#   apt-get install -y python3-tk    # paver
#   chmod g+w /vagrant
  SHELL

# config.vm.provision "provision-root", type: "shell", path: "provision-root.sh", privileged: true,  args: ENV['HLF_VERSION']
# config.vm.provision "provision-user", type: "shell", path: "provision-user.sh", privileged: false, args: ENV['HLF_VERSION']
end
